﻿using System.Windows.Forms;
namespace proba_pera
{
    public class RwpBaseObject
    {
        protected ListBox Log;
        protected bool LogIsOn = false;
        
        public void SetLog(ListBox l)
        {
            LogIsOn = true;
            Log = l;
        }

        public void UnsetLog()
        {
            LogIsOn = false;
        }

        public void ToLog(string txt)
        {
            if (!LogIsOn) return;
            Log.Items.Add(txt);
            Log.SelectedItem = Log.Items[Log.Items.Count - 1];
            Log.SelectedIndex = -1;
        }
    }
}